<html>
<head><meta charset="utf-8"><title>cargo vendor windows issues · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html">cargo vendor windows issues</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204214928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204214928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204214928">(Jul 17 2020 at 14:50)</a>:</h4>
<p>I have determined solutions to the issues gecko was seeing with <code>cargo vendor</code> on windows. I would be interested in feedback from cargo devs on a couple things described here: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1647582#c15">https://bugzilla.mozilla.org/show_bug.cgi?id=1647582#c15</a></p>
<p>tldr:</p>
<ol>
<li>
<p>cargo vendor looks up the user's <code>git config core.autocrlf</code> and respects it, which can cause vendorings to behave differently on windows than linux.</p>
</li>
<li>
<p>cargo 1.45 fixed an issue with vendor on windows that deterministically caused some dotfiles to get spuriously deleted/changed. It would be good to know what the issue was (no sign of the issue in the changelog).</p>
</li>
</ol>



<a name="204222630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204222630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204222630">(Jul 17 2020 at 15:48)</a>:</h4>
<p>The former seems wrong to me; no matter the setting there, we should vendor files with <em>exactly</em> the contents from upstream.</p>



<a name="204258490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204258490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204258490">(Jul 17 2020 at 21:00)</a>:</h4>
<p>Note that <code>core.autocrlf</code> is not the only pref that can affect crlf behavior in git (not entirely sure that's true for libgit2, though)</p>



<a name="204260719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204260719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204260719">(Jul 17 2020 at 21:20)</a>:</h4>
<p>I think it'd be appropriate for cargo-vendor to check in an exact copy of the source, without applying any filters or similar.</p>



<a name="204261740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204261740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mike Hommey <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204261740">(Jul 17 2020 at 21:29)</a>:</h4>
<p>I completely agree, FWIW. Just saying <code>core.autocrlf</code> may not be the only thing to look out for.</p>



<a name="204465898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204465898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204465898">(Jul 20 2020 at 19:33)</a>:</h4>
<p>I've spent the morning walking through the code of cargo/libgit2. After some confusion about how this could possibly be happening, I realized the crlf issue specifically only happens when vendoring <code>git</code> dependencies (e.g. lucet-wasi and spirv-cross-internal), which makes perfect sense. I'm currently looking at what needs to be changed ~here: <a href="https://github.com/rust-lang/cargo/blob/f12d72e11b8643b4851a50325d77af962931fe98/src/cargo/sources/git/utils.rs#L778-L779">https://github.com/rust-lang/cargo/blob/f12d72e11b8643b4851a50325d77af962931fe98/src/cargo/sources/git/utils.rs#L778-L779</a></p>



<a name="204466000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204466000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204466000">(Jul 20 2020 at 19:34)</a>:</h4>
<p>I'm pretty sure the lookup of the default git configs here is a red herring, and that config is only used to setup our auth protocols and then thrown away</p>



<a name="204466079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204466079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204466079">(Jul 20 2020 at 19:35)</a>:</h4>
<p>which is leaving me to believe that when we grab the Repository libgit2 is looking up and populating crlf configs.</p>



<a name="204466239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204466239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204466239">(Jul 20 2020 at 19:36)</a>:</h4>
<p>I don't see any explicit mention of crlf in the <code>git2</code> crate, so either we need to mutate the actual configs, or pass some special flag down to libgit2 -- not really sure what the right answer is</p>



<a name="204466404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204466404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204466404">(Jul 20 2020 at 19:38)</a>:</h4>
<p>(insights from a libgit2 veteran would be appreciated)</p>



<a name="204467145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204467145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204467145">(Jul 20 2020 at 19:44)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> pls help my vendors are dying</p>



<a name="204468176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204468176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204468176">(Jul 20 2020 at 19:54)</a>:</h4>
<p><span class="user-mention" data-user-id="137587">@Gankra</span> you're right that the linked location there shouldn't affect checkouts</p>



<a name="204468193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204468193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204468193">(Jul 20 2020 at 19:54)</a>:</h4>
<p>so we should use global git config or w/e for global checkouts</p>



<a name="204468203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204468203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204468203">(Jul 20 2020 at 19:54)</a>:</h4>
<p>er, for any checkouts</p>



<a name="204468337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204468337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204468337">(Jul 20 2020 at 19:55)</a>:</h4>
<p>er hm, actually...</p>



<a name="204468536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204468536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204468536">(Jul 20 2020 at 19:57)</a>:</h4>
<p>I think so,we should always use the global git config</p>



<a name="204468548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204468548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204468548">(Jul 20 2020 at 19:57)</a>:</h4>
<p>but I'm also not entirely sure what the issue is here</p>



<a name="204468571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204468571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204468571">(Jul 20 2020 at 19:57)</a>:</h4>
<p>it sounds like there's crlf issues, but I don't really understand how or when it shows up</p>



<a name="204471381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204471381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204471381">(Jul 20 2020 at 20:23)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> when we vendor a git source, mangling crlfs doesn't make sense, because the repo should be treated as read-only.</p>



<a name="204471441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204471441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204471441">(Jul 20 2020 at 20:23)</a>:</h4>
<p>but libgit2 <em>is</em> checking your global configs, and mangling the checkout when crlf=true</p>



<a name="204471558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204471558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204471558">(Jul 20 2020 at 20:24)</a>:</h4>
<p>er sorry, can you clarify?</p>



<a name="204471593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204471593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204471593">(Jul 20 2020 at 20:24)</a>:</h4>
<p>so like you want to vendor the exact binary bytes that are in the git repo's database, nothing crlf considered?</p>



<a name="204471890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204471890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204471890">(Jul 20 2020 at 20:27)</a>:</h4>
<p><span class="user-mention" data-user-id="116015">@Alex Crichton</span> if you <code>cargo vendor</code> a crate that depends on lucet-wasi via git with <code>git config core.autocrlf=false</code> and check the result into your project, and then someone else <code>cargo vendor</code>s with <code>autocrlf=true</code> on windows, there will be changes to the vendor even when the repo hasn't changed</p>



<a name="204471910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204471910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204471910">(Jul 20 2020 at 20:27)</a>:</h4>
<p>because we clobber the new lines</p>



<a name="204472018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472018">(Jul 20 2020 at 20:28)</a>:</h4>
<p>ok I think the fix here might be to fix our git checkout code then to always use a config with crlf mangling turned off</p>



<a name="204472028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472028">(Jul 20 2020 at 20:29)</a>:</h4>
<p>(I don't really know what <code>autocrlf</code> does)</p>



<a name="204472052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472052">(Jul 20 2020 at 20:29)</a>:</h4>
<p>but <code>cargo vendor</code> simply copies (effectively <code>cp</code>) from cargo's global checkout</p>



<a name="204472090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472090">(Jul 20 2020 at 20:29)</a>:</h4>
<p>so I think the buggy lines are showing up in cargo's global checkout which then get copied locally</p>



<a name="204472143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472143">(Jul 20 2020 at 20:29)</a>:</h4>
<p>ah ok, that makes sense. the abstraction over curl/git/local was obfuscating things a bit</p>



<a name="204472253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472253">(Jul 20 2020 at 20:30)</a>:</h4>
<p>is it as simple as tossing a <code>.gitconfig</code> file in the cargo global checkout?</p>



<a name="204472320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472320">(Jul 20 2020 at 20:31)</a>:</h4>
<p>it's probably best to figure out how to affect a <code>Conifg</code></p>



<a name="204472326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472326">(Jul 20 2020 at 20:31)</a>:</h4>
<p>er, a <code>git2::Config</code></p>



<a name="204472377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472377">(Jul 20 2020 at 20:31)</a>:</h4>
<p>this is the function that creates the checkout -- <a href="https://github.com/rust-lang/cargo/blob/f12d72e11b8643b4851a50325d77af962931fe98/src/cargo/sources/git/utils.rs#L145-L178">https://github.com/rust-lang/cargo/blob/f12d72e11b8643b4851a50325d77af962931fe98/src/cargo/sources/git/utils.rs#L145-L178</a></p>



<a name="204472401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472401">(Jul 20 2020 at 20:31)</a>:</h4>
<p>but there's a few different ways that the actual literal checkout happens</p>



<a name="204472463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472463">(Jul 20 2020 at 20:32)</a>:</h4>
<p>afaict a git2::Config only has ops that let you edit physical .gitconfigs..?</p>



<a name="204472466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472466">(Jul 20 2020 at 20:32)</a>:</h4>
<p>I believe that all reset operations flow through here though -- <a href="https://github.com/rust-lang/cargo/blob/f12d72e11b8643b4851a50325d77af962931fe98/src/cargo/sources/git/utils.rs#L668-L679">https://github.com/rust-lang/cargo/blob/f12d72e11b8643b4851a50325d77af962931fe98/src/cargo/sources/git/utils.rs#L668-L679</a></p>



<a name="204472502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472502">(Jul 20 2020 at 20:32)</a>:</h4>
<p>I think it persists in-memory state as well</p>



<a name="204472511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472511">(Jul 20 2020 at 20:32)</a>:</h4>
<p>I'd probably test out modifying <code>reset</code></p>



<a name="204472530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472530">(Jul 20 2020 at 20:32)</a>:</h4>
<p>extracting the repo's <code>Config</code> or something like that</p>



<a name="204472539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472539">(Jul 20 2020 at 20:32)</a>:</h4>
<p>I forget what libgit2 gives as knobs in that regard</p>



<a name="204472560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472560">(Jul 20 2020 at 20:32)</a>:</h4>
<p>right but like, if I ask a Config to set autocrlf, it will write to a .gitconfig somewhere, right?</p>



<a name="204472600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472600">(Jul 20 2020 at 20:33)</a>:</h4>
<p>no idea</p>



<a name="204472652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472652">(Jul 20 2020 at 20:33)</a>:</h4>
<p>I"d start by calling <code>Repository::config()</code></p>



<a name="204472655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472655">(Jul 20 2020 at 20:33)</a>:</h4>
<p>and then calling <code>set_bool</code></p>



<a name="204472757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472757">(Jul 20 2020 at 20:34)</a>:</h4>
<p>do that before the <code>reset --hard</code> and see if that helps</p>



<a name="204472766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472766">(Jul 20 2020 at 20:34)</a>:</h4>
<p>"Set the value of a string config variable in the config file with the highest level (usually the local one)."</p>



<a name="204472788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472788">(Jul 20 2020 at 20:34)</a>:</h4>
<p>sounds like it writes to a file</p>



<a name="204472887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204472887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204472887">(Jul 20 2020 at 20:35)</a>:</h4>
<p>i just wanna be sure we're ok with that -- it's unclear to me how much gitconfigs get checked in / how much we need to respect that</p>



<a name="204474426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204474426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204474426">(Jul 20 2020 at 20:51)</a>:</h4>
<p>I think it should be fine if it writes a .gitconfig</p>



<a name="204474432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204474432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204474432">(Jul 20 2020 at 20:51)</a>:</h4>
<p>we write a random .cargo-ok file in there too</p>



<a name="204475281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204475281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204475281">(Jul 20 2020 at 20:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116015">Alex Crichton</span> <a href="#narrow/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues/near/204472018">said</a>:</p>
<blockquote>
<p>ok I think the fix here might be to fix our git checkout code then to always use a config with crlf mangling turned off</p>
</blockquote>
<p>We should also avoid filters, though I think libgit2 does that by default (because they'd involve invoking an external program).</p>



<a name="204475408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204475408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204475408">(Jul 20 2020 at 21:00)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116015">Alex Crichton</span> <a href="#narrow/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues/near/204474426">said</a>:</p>
<blockquote>
<p>I think it should be fine if it writes a .gitconfig</p>
</blockquote>
<p>You'd want to set the option in <code>.git/config</code>. Git doesn't look at <code>.gitconfig</code> in the repository, that'd be unsafe.</p>



<a name="204475428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204475428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204475428">(Jul 20 2020 at 21:00)</a>:</h4>
<p>(Alternatively, we could just override it in the <code>Config</code> without persisting that to disk.)</p>



<a name="204495006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/cargo%20vendor%20windows%20issues/near/204495006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Gankra <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/cargo.20vendor.20windows.20issues.html#204495006">(Jul 20 2020 at 23:01)</a>:</h4>
<p>ok, fixed? <a href="https://github.com/rust-lang/cargo/pull/8523">https://github.com/rust-lang/cargo/pull/8523</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>